import React from 'react';
import qs from "qs";

export default function toAuth(redirect_uri){
    const openid = localStorage.getItem("openid");
    console.log(redirect_uri)
    if (openid){
        return
    }
    const appid = "wx4f4311d68ab529b4";
    const params = {
        appid,
        redirect_uri,
        response_type:Math.random(),
        scope:   "snsapi_base",
        state:new Date().valueOf()
    }
    // window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?${qs.stringify(params)}`;
};